﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Bson.Serialization.IdGenerators;
using MongoDB.Bson;

namespace Teein.Proxy.Bot.Model
{
    public class ProxyInfo
    {
        private ObjectId m_PID;

        [BsonId]
        public ObjectId PID
        { 
            get{
                if (m_PID == ObjectId.Empty)
            {
                m_PID = ObjectId.GenerateNewId();
            }
            return m_PID;
        }
            set {
                m_PID = value;
            }
        }
        public string IP { get; set; }
        public int Port { get; set; }
        public string State { get; set; }
        public double Ping { get; set; }
        public int RequestCount { get; set; }
        public DateTime CreateDate { get; set; }
        public DateTime LastTime { get; set; }
        public bool IsUse { get; set; }
    }
}
